Skip to content

Instantly share code, notes, and snippets.

View khadorkin's full-sized avatar

Dima Khadorkin khadorkin

  • Mobile Roadie
  • Vilnius, Lithuania
  • 22:00 (UTC +03:00)
View GitHub Profile
@msakai
msakai / FlightRadar24.hs
Created August 10, 2012 22:56
Sample for fetching JSON data from flightradar24.com
import Control.Concurrent
import Control.Monad
import Data.Maybe
import Data.Time
import Network.Browser
import Network.HTTP
import Network.HTTP.Proxy
import Network.URI
import System.Locale
@saippuakauppias
saippuakauppias / gist:4714695
Last active August 24, 2019 04:35
javascript vkontakte api wall post: постинг на стену к текущему пользователю на JS vk API. С помощью этого кода так же можно отправлять записи на стены групп, пользователей и публичных страниц (пабликов). Используется в iframe приложениях вконтакте.
/*
* message - сообщение, которое будет опубликовано
* image - картинка для постинга
* user_id - id текущего пользователя (к нему будет осуществлён постинг)
*/
function wallPost(message, image, user_id) {
VK.api('photos.getWallUploadServer', {
uid: user_id
}, function (data) {
if (data.response) {
<script>
// fbAsyncInit
// http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId: '<?php echo(FB_APP_ID); ?>',
status: true,
cookie: true,
xfbml: true,
@brandonmwest
brandonmwest / example.cs
Last active January 16, 2024 15:52
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));
@mqli
mqli / Few Line of Hack Code Make React-Native Run on Windows.md
Last active July 13, 2017 19:14
Few Line of Hack Code Make React-Native Run on Windows

#Few Line of Hack Code Make React-Native Run on Windows

While React-Native just add support of Android,yet officeally they just only support on OSX.

After a few hours of debugging, I find a simple way of let React-Native run on Windows.

Make sure all requirements were all setup following this:

Then initilize the project following this:

@parmentf
parmentf / GitCommitEmoji.md
Last active June 21, 2024 07:01
Git Commit message Emoji
@brandondurham
brandondurham / styles.less
Last active January 11, 2024 06:46
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
#!/usr/bin/env bash #adding this to force silly gist highlighting. REMOVE THIS
# This is a modified version of the script generated by https://docs.npmjs.com/cli/completion to include `npm install` autocompletion.
# Basically we added `if` blocks to check for `install` subcommand.
###-begin-npm-completion-###
#
# npm command completion script
#
# Installation: npm completion >> ~/.bashrc (or ~/.zshrc)
@acdlite
acdlite / app.js
Last active January 20, 2023 08:23
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@aripalo
aripalo / styles.less
Created October 6, 2016 13:25
Atom with Operator Mono Screensmart
// base styles
atom-workspace,
atom-text-editor {
font-family: "Operator Mono SSm";
font-size: 13px;
font-weight: 400;
line-height: 1.7;
}