Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Akshaydeep Giri ooooak

🏠
Working from home
View GitHub Profile
@ooooak
ooooak / gist:8630906fba860b91701b06cddbe880c1
Last active Nov 26, 2016
my crosshair for 1280 x 960
View gist:8630906fba860b91701b06cddbe880c1
cl_crosshairstyle 2;
cl_crosshairalpha 255;
cl_crosshairdot 0;
cl_crosshairsize 2;
cl_crosshairthickness 0.5
cl_crosshairgap 3;
// green
cl_crosshaircolor 1;
View s.py
def index(request):
if request.method == 'GET':
return render(request,'task/index.html')
elif request.method == 'POST':
t = request.POST.get("task", "")
fb = get_fb(t) ...
ig = get_insta(t)
tw = get_twitter(t)
gp = get_gplus(t)
result = True
View stackoverflow.rs
#[derive(Debug, Clone, Copy)]
pub struct User<'a>{
pub token: &'a Vec<String>,
pub look: &'a usize,
}
impl<'a> User<'a>{
pub fn display(self){
println!("{:?}", self);
View life.rs
#[derive(Debug, Clone, Copy)]
pub struct User<'a>{
pub Token: &'a Vec<String>,
pub look: &'a usize,
}
impl<'a> User<'a>{
pub fn display(u: User){
println!("{:?}", u);
}
@ooooak
ooooak / gist:a75c3611663932be92f1
Created Oct 17, 2015
resize image in python [linux only]
View gist:a75c3611663932be92f1
import os
import glob
path = '~/send/*.JPG'
files = glob.glob(path)
for f in files:
os.system('convert -resize 24% ' + f + ' ' + f.replace('/send/', '/send/new/'))
View play.rs
fn main() {
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;println!("It works :)");;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
}
@ooooak
ooooak / create_tank_auth_tables.php
Created Sep 14, 2015
Tank auth table scheme for laravel
View create_tank_auth_tables.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTankAuthTables extends Migration
{
/**
* Run the migrations.
*
@ooooak
ooooak / func.php
Created Sep 14, 2015
laravel bcrypt function
View func.php
<?php
function bcrypt($password)
{
$hash = password_hash($password, PASSWORD_BCRYPT, ['cost' => 10]);
if ($hash === false)
{
throw new RuntimeException('Bcrypt hashing not supported.');
}
View play.rs
#[derive(Debug)]
enum Lx {
Str(String),
Int(String),
Keyword(String),
LxUnk(char),
}
fn main() {