Skip to content

Instantly share code, notes, and snippets.

View kadeer's full-sized avatar

Abdulkadir N. A. kadeer

View GitHub Profile
@constructor-s
constructor-s / PrintPDF.ahk
Created March 26, 2020 19:54
AutoHotKey to print current page to PDF in browser
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
^j::
Click
Sleep, 500
Send, ^p
Sleep, 1000
@davidfowl
davidfowl / DelayCounter.cs
Last active February 6, 2019 10:23
Count up from 0 to {count}, showing an item every {delay} milliseconds
public IObservable<int> ObservableCounter(int count, int delay)
{
return Observable.Range(0, count).Zip(
Observable.Interval(TimeSpan.FromMilliseconds(delay)), (item, _) => item);
}
@sadikay
sadikay / google_fonts.css
Created April 26, 2017 22:34
All Google Fonts In One CSS File
@font-face {
font-family: 'ABeeZee';
font-style: normal;
font-weight: 400;
src: local('ABeeZee'), local('ABeeZee-Regular'), url(http://fonts.gstatic.com/s/abeezee/v9/JYPhMn-3Xw-JGuyB-fEdNA.ttf) format('truetype');
}
@font-face {
font-family: 'Abel';
font-style: normal;
font-weight: 400;
@thomasmery
thomasmery / custom_row_renderer.jsx
Last active June 14, 2021 14:36
Adding props to a React Virtualized custom row renderer
/**
* External dependencies
*/
import React, { PureComponent, PropTypes } from 'react';
import { AutoSizer, Table } from 'react-virtualized';
/**
* Internal dependencies
**/
import getDefaultColumns from './columns'; // some columns for RV Table
@Miouyouyou
Miouyouyou / Linux_DRM_OpenGLES.c
Last active May 31, 2024 03:27
An example, inspired by Rob Clark "kmscube.c" that uses Linux Direct Rendering Manager ( DRM ) and EGL to create an OpenGL ES 2 context. This is a standalone example, that just clears the screen with a blueish color. Usable with Rockchip DRM drivers and Mali Wayland/DRM userspace drivers.
// gcc -o drmgl Linux_DRM_OpenGLES.c `pkg-config --cflags --libs libdrm` -lgbm -lEGL -lGLESv2
/*
* Copyright (c) 2012 Arvin Schnell <arvin.schnell@gmail.com>
* Copyright (c) 2012 Rob Clark <rob@ti.com>
* Copyright (c) 2017 Miouyouyou <Myy> <myy@miouyouyou.fr>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
@ghstahl
ghstahl / GraphQLStarWarsExtension
Created December 23, 2016 19:32
Autofac registration for the GraphQL StarWars types
// https://github.com/graphql-dotnet/graphql-dotnet
public static class GraphQLStarWarsExtension
{
public static void RegisterGraphQLTypes(this ContainerBuilder builder)
{
builder.RegisterInstance(new DocumentExecuter()).As<IDocumentExecuter>();
builder.RegisterInstance(new DocumentWriter()).As<IDocumentWriter>();
builder.RegisterInstance(new StarWarsData()).As<StarWarsData>();
@iamakulov
iamakulov / index.md
Last active May 22, 2020 15:28
Fixing babel-plugin-add-module-exports in Webpack 2

babel-plugin-add-module-exports generates an incorrect bundle if you use ES modules in the latest versions of Webpack 2 (at least in 2.1.0-beta.27 and .28). Here’s what to do.

1. Remove the plugin:

{
  "plugins": [
-   "add-module-exports"
  ]
}
@davidfowl
davidfowl / Example1.cs
Last active June 19, 2024 16:41
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@chrisui
chrisui / action.js
Created April 11, 2016 19:22
Thunk Middleware with Custom API Utils
// Now your action creators can pull utilities our of their thunk api!
export function fetchUser(id) {
return ({api, dispatch}) =>
api.fetch(`users/${id}`).then(resp =>
dispatch({action: FETCH_USER, user: resp.body.data}));
}
@NickCraver
NickCraver / Readme.md
Created April 10, 2016 19:40
A simple LINQPad script I wrote for load testing SQL Server.

This is a simple LINQPad script I wrote one day to load test some large SQL servers. Maybe it's useful to someone. The basic premise is defining your queries once, including which ID patterns to fetch (at the bottom), and load test a mixture. The script defines everything needed in one place, then fires up the command-line linqpad runner to run many queries at once.

Params up top:

const string LinqPadPath = @"C:\Linqpad\lprun.exe";
const bool runSequential = false;
const int defaultThreads = 1;
const int defaultIterations = 2000;