Skip to content

Instantly share code, notes, and snippets.

View Sathyaish's full-sized avatar
💭
https://sathyaish.net/ThoughtForTheDay

Sathyaish

💭
https://sathyaish.net/ThoughtForTheDay
View GitHub Profile
@Sathyaish
Sathyaish / dropdown
Created November 4, 2019 09:45 — forked from Vardner/dropdown
Simple dropdown menu
HTML:
<div data-dropdown="toggle">
<div>Block</div>
<ul data-dropdown="target">
<li>
<a f href="javascript: void(0)" class="category-menu__item-link">
<span>
TEXT
</span>
</a>
@Sathyaish
Sathyaish / CryptoJS_byteArrayWordArrayConversions.js
Created October 24, 2019 07:39 — forked from artjomb/CryptoJS_byteArrayWordArrayConversions.js
Convert a byte array to a word array and back in CryptoJS-compatible fashion
function byteArrayToWordArray(ba) {
var wa = [],
i;
for (i = 0; i < ba.length; i++) {
wa[(i / 4) | 0] |= ba[i] << (24 - 8 * i);
}
return CryptoJS.lib.WordArray.create(wa, ba.length);
}
/**
* In the example response below, observe each snippet has an object named resourceId,
which has a property named videoId. So, to get that in the response, to the fields query string
parameter, add the following path: resourceId/videoId.
So, your fields parameter now becomes:
pageInfo, items/snippet(title, description, resourceId/videoId)
*/
{
@Sathyaish
Sathyaish / RouteConfig.cs
Created February 10, 2017 13:36 — forked from RyannosaurusRex/RouteConfig.cs
ASP.NET MVC Subdomain Routing
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Sub", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "SubdomainController", action = "AnyActionYouLike", id = UrlParameter.Optional },
package Practice.Java.Swing;
public class MainWindow extends JFrame {
private static final long serialVersionUID = 1L;
public MainWindow(String title) {
super(title);
Initialize();
using System;
using System.Collections.Generic;
namespace NullObjectDesignPattern
{
public class Employee
{
public string Name { get; set; }
public Bonus Bonus { get; set; }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NullObjectDesignPattern
{
// Bad design example
abstract class Customer { public virtual string Name { get; set; } }
using System;
using System.Linq;
using System.Reflection;
namespace NullObjectDesignPattern
{
class Program
{
static void Main(string[] args)
{
using System;
using System.Linq;
using System.Reflection;
namespace NullObjectDesignPattern
{
class Program
{
static void Main(string[] args)
{