View .Xmodmap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove control = Super_L | |
keycode 37 = Mode_switch | |
keycode 31 = i I Up Up | |
keycode 44 = j J Left Left | |
keycode 45 = k K Down Down | |
keycode 46 = l L Right Right⏎ |
View convert.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
for file in toconvert/* | |
do | |
filename=`pwd`/$file | |
basename=`echo $filename | sed 's/.*toconvert\/\(.*\)\.[^\.]*$/\1/'` | |
targetname=`pwd`/converted/$basename'.mp4' | |
ffmpeg -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -i $filename -loglevel error -c:v h264_vaapi $targetname -y | |
done | |
echo 'done' |
View install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
mkdir ~/tmp | |
cd ~/tmp | |
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz | |
tar -xvf yasm-1.3.0.tar.gz | |
cd yasm-1.3.0/ | |
make && sudo make install | |
cd ~/tmp |
View hashtest.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string> | |
#include <eosiolib/eosio.hpp> | |
#include <eosiolib/crypto.h> | |
using namespace eosio; | |
class Hashtest : public contract { | |
public: |
View OracleTest.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.23; | |
import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; | |
contract OracleTest is usingOraclize { | |
bool public isTrue; | |
event NewOraclizeQuery(string _description); | |
event NewOracleResultCount(bool _isTrue); |
View nestedPromise.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const wait = true; | |
const success = false; | |
const promise2 = new Promise((res, rej) => { | |
if (success) { | |
setTimeout(res, 1000, 2) | |
} else { | |
rej(3) | |
} | |
}); |
View calc.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from lark import Lark, Transformer | |
class Calculator(Transformer): | |
def addition(self, items): | |
return items[0] + items[1] | |
def substraction(self, items): | |
return items[0] - items[1] |
View mentekun.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
module Middlewares | |
class Mentekun | |
CONFIG = { | |
users: { | |
read: [ | |
{ methods: [:get], path: '/api/users' }, | |
{ methods: [:get], path: %r{/api/users/\d+} }, |
View Problems_first.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Your task is to implement the sum() function so that it computes the sum of | |
* all elements in the given array a. | |
*/ | |
fun sum(a: IntArray): Int { | |
when { | |
a.size > 0 -> return a.reduce{s1, s2 -> s1 + s2} | |
else -> println("Array must be longer than 2") | |
} |
View pca_full.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy | |
import random | |
def create_datas(): | |
datas = [] | |
for i in range(20): | |
a = 10 * (random.random() - 0.5) | |
datas.append((a, a + 3 * (random.random() - 0.5))) | |
return datas |
NewerOlder