Skip to content

Instantly share code, notes, and snippets.

View Nek's full-sized avatar
🏠
Working from home

Nikita Dudnik Nek

🏠
Working from home
View GitHub Profile
@tokumine
tokumine / ubuntu_laptop.md
Created January 9, 2012 23:33
Best Ubuntu laptop?

Weirdly, there's not an awful lot of information on what makes a light, fast and modern Linux laptop on the internet, even for a popular distribution like Ubuntu. I like to run Ubuntu as, for better or worse, it's what we use on our production systems.

Normally with linux laptops, you run the gauntlet of esoteric specialist hardware matched up with shaky drivers - a sure fire recipe for burning a weekend (or few weeks even). It's such drudgery to have to plod through all this stuff. I need a decent laptop that I can install Ubuntu on and for everything to just work.

By everything, I mean all of it - wireless (b/g/n), gigabit ethernet, battery indicator, cpu stepping, VGA port/dongle, bluetooth, HDMI port, sleep, SD card reader, camera, microphone, usb, multitouch (especially two-finger scroll) and special laptop keys like brightness and volume. I wanted as near to zero config as possible with good default choices.

I decided to take an educated guess on such a linux laptop recently: the Samsung 350U (speci

(ns react-cljs.core
(:require React))
(declare render)
(defn handle-change [e]
(render {:text (.. e -target -value)}))
(defn render [{:keys [text]}]
(React/renderComponent
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@tkachenko1503
tkachenko1503 / why-do-we-need-types-in-javascript.md
Last active April 21, 2020 10:35
Do we need types in JavaScript? Or maybe not?

This is my lightning talk submission to ReactiveConf 2018 https://reactiveconf.com/

In this talk, I want to share my experience gained during the development of frontend applications in several programming languages.

I think it's not a secret for anybody that developing large JavaScript applications is not so easy as it seems at first glance. We all want something simpler and more reliable. Therefore, many developers and even entire companies switch to different, compiled in JavaScript, programming languages. The bulk of such transitions is accounted for TypeScript and flow, and often, developers faced with more problems than they were before.

I wasn't the exception. Moving to a new project, I started using TypeScript and was disappointed. Luckily in my next project I used ClojureScript and it was like everything is illuminated!

@joelnet
joelnet / example.html
Created June 3, 2011 18:03
Unobtrusive Knockout support library for jQuery
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
@mchakravarty
mchakravarty / InlineObjC.hs
Created January 25, 2013 07:42
Example of how inline Objective-C in Haskell might look like.
dumpURL :: String -> IO ()
dumpURL urlString
= do
{ urlData <- $objc 'urlString [cstm| {
return [NSString stringWithContentsOfURL: [NSURL urlWithString: urlString]
encoding: NSUTF8StringEncoding
error: NULL];
} |]
; putStr urlData
}
@statico
statico / gist:3172711
Created July 24, 2012 21:15
How to use a PS3 controller on Mac OS X 10.7 (Lion)

How to use a PS3 controller on Mac OS X 10.7 (Lion)

  1. Open Apple menu -> System Preferences -> Bluetooth and disable Bluetooth on Mac as well as any other nearby Macs or devices which will try to pair with and confuse the controller.

  2. Reset PS3 controller by inserting paperclip into pinhole near L2 button.

  3. Connect PS3 controller to Mac with USB cable.

  4. Enable Bluetooth.

@Quasimondo
Quasimondo / hic_et_nunc_basic_scraper.py
Created March 10, 2021 11:23
This is a very basic no-frills scraper to retrieve the metadata and digital assets from all tokens minted on hicetnunc.xyz. I share this as a starting point for people who want to experiment with building alternative views on the works created on the platform or preserve the data. Feel free to improve upon this or add additional features.
import requests
import os
import ipfsApi
api = ipfsApi.Client(host='https://ipfs.infura.io', port=5001)
url = "https://better-call.dev/v1/contract/mainnet/KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton/tokens"
r = requests.get(url)
data = r.json()
@etscrivner
etscrivner / picture-language.rkt
Created May 27, 2015 05:43
Complete racket source code for playing with the SICP picture language.
#lang racket/gui
(require graphics/graphics)
(open-graphics)
(define vp (open-viewport "A Picture Language" 500 500))
(define draw (draw-viewport vp))
(define (clear) ((clear-viewport vp)))
(define line (draw-line vp))
(define (make-vect x y)
@idlebit1
idlebit1 / gist:c5828bb7ec0006c7aeb92fdc93c7bb0b
Created May 15, 2022 19:47
How to make web audio / tone.js play while iphone is muted.
// This gist copyright IdleBit 2022, MIT License
var isIOS = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || isIOS
var isFirefox = /Firefox/i.test(navigator.userAgent)
// call this from first click action
function startSound() {
if (isIOS) {
try{