Skip to content

Instantly share code, notes, and snippets.

View pasevin's full-sized avatar
💭
I may be slow to respond.

Aleksandr Pasevin pasevin

💭
I may be slow to respond.
View GitHub Profile
@jonathanhoskin
jonathanhoskin / reboot-modem.js
Last active September 29, 2021 13:34
Huawei B315 Modem Reboot Script
// PhantomJS script to reboot a Huawei B315 modem
//
// Author: Jonathan Hoskin / 2017-09-02
// Twitter: @jhossnz
// Github: https://github.com/jonathanhoskin
//
// Requires PhantomJS ~ 2.1.1
//
// Enter your own modem details here
var username = 'admin';
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

import datetime
from pprint import pprint as pp
from trello import TrelloClient
client = TrelloClient(
api_key='your-key',
api_secret='your-secret',
token='your-oauth-token-key',
/**
* Extends Webflow Slider with public methods to swich between slides
*
* Paste this code on the Custom Code panel to get started:
*
* var slider = new W_SLIDER_CONTROLLER( '#element_id' );
* slider.setup('drag_disabled') // removes the drag-and-slide interaction
* slider.goto( 2 ); // jumps to the second slide
*/
var W_SLIDER_CONTROLLER = function( el ){
@xinan
xinan / material-theme.itermcolors
Created August 1, 2015 16:18
Material Theme iTerm2 Port
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.25882352941176467</real>
<key>Green Component</key>
<real>0.21176470588235294</real>
@webinista
webinista / RunAProxyOnAmazonEC2VPC.md
Last active April 27, 2024 12:21
Create a proxy server on an Amazon EC2 (VPC) instance

This will create a proxy server in whatever your availability zone your VPC is in. For me, that's us-east-1b. For you, that may be something different. Steps 10+ should more or less work regardless of your provider since those steps cover the setup and configuration of TinyProxy.

  1. Click the Launch Instance button.
  2. Choose Ubuntu Server 14.04 LTS (HVM), SSD Volume Type. This isn't strictly necessary. If you choose another OS, check its documentation for how to install new packages.
  3. On the Choose an Instance Type screen, select t2.micro. It's Free Tier eligible.
  4. Click the Next: ... buttons until you reach the Configure Security Group screen.
    • You may wish to reduce the amount of storage on the Add Storage screen. This is optional.
    • You may wish to add a tag on the Tag Instance screen. This is also optional.
  5. On the Configure Security Group screen:
  • Select Create a new security group.
@pasevin
pasevin / gist:3879901
Created October 12, 2012 15:51
Media Queries for Standard Devices | CSS - Tricks
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@katrinkerber
katrinkerber / Colors.xml
Created May 30, 2011 12:34
Dark Dreamweaver theme based on 'minimal Theme' for TextMate (http://minimaldesign.net/downloads/tools/textmate-theme). Optimised for HTML, CSS, JS and PHP. For installation see http://is.gd/Add9mq. Set background color to #25221C.
<codeColors>
<colorGroup>
<syntaxColor id="CodeColor_HTMLEntity" text="#AECD9D" bold="true" />
<syntaxColor id="CodeColor_JavascriptNative" text="#FCFFE7" />
<syntaxColor id="CodeColor_JavascriptNumber" text="#FBAA21" />
<syntaxColor id="CodeColor_JavascriptClient" text="#FCF296" />
<syntaxColor id="CodeColor_JavascriptSpryKeywords" text="#FF6208" />
<syntaxColor id="CodeColor_JavascriptSpryClasses" text="#FF6208" />
<syntaxColor id="CodeColor_TemplateText" text="#999999" />
<syntaxColor id="CodeColor_TemplateCommentText" text="#82806F" />