Skip to content

Instantly share code, notes, and snippets.

View pinscript's full-sized avatar

Alexander Berg pinscript

View GitHub Profile
@pinscript
pinscript / laugh.js
Last active August 29, 2015 13:59
laugh.js
if(message.toLowerCase() == "haha") {
var images = [
"http://i.imgur.com/tyROdzN.gif",
"http://i.imgur.com/L24cy.gif",
"http://i.imgur.com/nJTgg7p.gif",
"http://i.imgur.com/VaAvSEj.gif",
"http://i.imgur.com/rU2jU8X.gif",
"http://i.imgur.com/cUqCb7Y.gif",
"http://i.imgur.com/yFtfY.gif",
@pinscript
pinscript / hello.tmpl
Created July 3, 2014 08:34
Gin HTML template example
Hello world, {{.Name}}!
package main
import (
"fmt"
"github.com/gin-gonic/gin"
)
func CORSMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
c.Writer.Header().Set("Content-Type", "application/json")
package main
import (
"fmt"
"time"
"github.com/alexandernyquist/gin" // at 30ea9c06fc9cac893f10d6ad0847a510cf35aeaf
)
func main() {
r := gin.NewWithConfig(gin.Config{
CacheSize: 5,

Conspiracy and an off-by-one error

Here, I will discuss one of the conspiracy theories regarding the attack on Malaysia Airline flight MH17. This will not be about formulating yet another theory - or blaming anyone for what happened. I will focus purely on independently verifyable technical matters.

If you want to follow along, you will need these tools:

Claims

#!/bin/sh
echo "-----"
echo "Deploying"
echo "-----"
# Update sourcecode
git pull
# Update composer
composer install
<?php
$search = 'annonsmannen';
$fileName = 'movies.list'; // From ftp://ftp.sunet.se/pub/tv+movies/imdb/movies.list.gz
$fp = fopen($fileName, 'r');
for(;;) {
$line = fgets($fp);
if($line === false) {
print('Reached end of file. Movie not found');
break;
<?php
$data = json_decode($json, true);
uasort($data['allresults'], function($a, $b) {
$aSalary = $a['results'][0]['salary'];
$bSalary = $b['results'][0]['salary'];
return $bSalary < $aSalary;
});
@pinscript
pinscript / FindRec.ps
Created December 19, 2014 10:33
Find in files recursive
Function FindRec($filepattern, $pattern) {
Get-ChildItem -Recurse -Include $filepattern | Select-String -Pattern $pattern | Group path | Select name
}

Keybase proof

I hereby claim:

  • I am alexandernyquist on github.
  • I am alexandern (https://keybase.io/alexandern) on keybase.
  • I have a public key whose fingerprint is ABC8 2A84 7ECA 7AC4 4A46 076E 9297 0F1E B5FD EF16

To claim this, I am signing this object: