Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@danil-z
danil-z / make-spm-playground.sh
Created March 23, 2020 02:08 — forked from finestructure/make-spm-playground.sh
Make a playground with access to an SPM library ready for importing
#!/usr/bin/env bash
set -eux
PROJ_NAME=myproj2
PKG_URL=https://github.com/johnsundell/plot.git
PKG_FROM=0.1.0
LIB_NAME=Plot
SWIFT_VERSION=5.1.3
PLATFORM=macos
@danil-z
danil-z / oclint-json-compilation-database-parallel
Last active August 29, 2015 14:26 — forked from tommeier/oclint-json-compilation-database-parallel
oclint-json-compilation-database with parallel execution
#!/usr/bin/env python
# Test run with parallel
import os
import platform
import json
import argparse
import re
import subprocess
import sys
@danil-z
danil-z / oclint.rb
Last active November 6, 2015 11:44 — forked from TonyAnhTran/oclint.rb
require 'formula'
class Oclint < Formula
homepage 'http://oclint.org'
url 'http://archives.oclint.org/nightly/oclint-0.9.dev.603daa8-x86_64-darwin-14.4.0.tar.gz'
version '0.9.dev.603daa8'
sha1 '9ee49d2fd167eec09e1a33a56081c1bb22721f0d'
def install
lib.install Dir['lib/clang']
@danil-z
danil-z / brew.rb
Last active August 29, 2015 14:26 — forked from royingantaginting/brew.rb
Brew formula to install oclint version 0.8.1 or 0.9.dev.02251e4
require 'formula'
class Oclint < Formula
homepage 'http://oclint.org'
url 'http://archives.oclint.org/releases/0.8/oclint-0.8.1-x86_64-darwin-14.0.0.tar.gz'
version '0.8.1'
sha1 'c96d712c5b73e04eebb57c3a97dec2b4ecbb9ed4'
devel do
url 'http://archives.oclint.org/nightly/oclint-0.9.dev.603daa8-x86_64-darwin-14.4.0.tar.gz'
@danil-z
danil-z / primus_jwt.js
Created January 24, 2015 20:15
primus jwt
'use strict';
var Primus = require('primus.io'),
authParser = require('parse-bearer-token'),
config = require('../../../config'),
debug = require('debug')('myprimus'),
jwt = require('jsonwebtoken');
function authCheck(token, req, done){
jwt.verify(token, config.jwt_secret, function(err, decoded) {
if (err) {
@danil-z
danil-z / gist:9642347
Last active August 29, 2015 13:57
print receipt
- (NSData *)create2InchReceipt
{
User *user = [User getInstance];
NSMutableData *commands = [[NSMutableData alloc] init];
[commands appendBytes:"\x1d\x57\x80\x31"
length:sizeof("\x1d\x57\x80\x31") - 1]; // Page Area Setting <GS> <W> nL nH (nL = 128, nH = 1)
[commands appendBytes:"\x1b\x61\x01"
@danil-z
danil-z / style.scss
Created August 22, 2013 19:20 — forked from daz/style.scss
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;
# Russian. Updated 2012-07-18
ru:
admin:
home:
name: "Главная"
pagination:
previous: "&laquo; Предыдущая"
next: "Следующая &raquo;"
truncate: "…"
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}