Skip to content

Instantly share code, notes, and snippets.

@yassinagx
yassinagx / ln-etude.html
Created June 7, 2023 12:42
Iframe pour l'étude "Lingustique et numérique"
<iframe src="https://etudes.fable-lab.com/mediations-linguistique-et-numerique" width="100%" height="800vh"></iframe>
@yassinagx
yassinagx / messagepack_client.js
Created June 3, 2023 15:56 — forked from faisal00813/messagepack_client.js
Client for sending the packed messagepack data to web server
const request = require('request')
const msgpack = require("msgpack-lite");
var packedData = msgpack.encode({
"str" : "Something",
"number" : 4.0,
"arr": ["one","two"],
"nClass": {
"doubleNumber" : 35.0,
"nums" : [34,23]

Rails & Trix: Add Underline, Superscript, and Subscript

This guide will walk you through adding some extra features such as the ability to underline your text, or enhance your content by adding superscripts or subscripts for annotations or Math equations.

Prerequisites: Instruction guide assumes that you have created a Rails application and installed ActionText.

What will you learn:

@yassinagx
yassinagx / amh.csv
Last active April 13, 2022 11:14
amh.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
1;architecte;GCI;አርክቴክት
2;assemblage;GCI;ስብሰባ
3;avant-gare;GCI;
4;avoisinant;GCI;ጎረቤት
5;balayeuse;GCI;መጥረጊያ
6;balisage;GCI;ምልክት ማድረጊያ
7;base vie;GCI;የሕይወት መሠረት
8;baudrier;GCI;ማሰሪያ
9;benne;GCI;የቆሻሻ መጣያ
10;benne à béton;GCI;ኮንክሪት ባልዲ
@yassinagx
yassinagx / flac-to-mp3.sh
Created March 4, 2022 13:09 — forked from ksu006/flac-to-mp3.sh
Script to convert .flac audio files into 320kbps .mp3 files (need flac and lame installed)
#!/bin/sh
for file in *.flac; do flac -cd "$file" | lame -h -b 320 - "${file%.flac}.mp3"; done
@yassinagx
yassinagx / conditional_chaining_with_tap.rb
Created February 2, 2022 14:29 — forked from abachman/conditional_chaining_with_tap.rb
Conditional query chaining in Rails 3
# I want a list of 6 non-administrators who are not the
# current user only if someone is logged in. Otherwise,
# don't check current_user's id.
# instead of this:
if user_signed_in?
@other_users = User.non_admin.limit(6).where("name IS NOT NULL")
else
@other_users = User.non_admin.limit(6).where(['id != ?', @user.id]).where("name IS NOT NULL")
@yassinagx
yassinagx / index.md
Created October 19, 2017 19:07 — forked from rstacruz/index.md
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@yassinagx
yassinagx / install-arduino-ubuntu.sh
Last active November 28, 2016 09:30
Script installer arduino for ubuntu
cd ~
wget https://www.arduino.cc/download.php?f=/arduino-1.6.12-linux64.tar.xz
tar -vxf download.php?f=%2Farduino-1.6.12-linux64.tar.xz
cd arduino-1.6.12-linux64.tar.xz
chmod +x ./install.sh
./install.sh
cd /etc/udev/rules.d/
echo KERNEL=="ttyACM[0-9]*",MODE="666" > arduino.rules
echo KERNEL=="ttyUSB[0-9]*",MODE="666" >> arduino.rules
reboot
sudo nmap -sP 192.168.1.0/24 | awk 'BEGIN{ORS=" "}/^Nmap/{ip=$NF}/B8:27:EB/{print "pi@"""ip}' | pbcopy
#include <EEPROM.h>
//Pin connected to latch pin (ST_CP) of 74HC595
const int latchPin = 11;
//Pin connected to clock pin (SH_CP) of 74HC595
const int clockPin = 13;
//Pin connected to Data in (DS) of 74HC595
const int dataPin = 8;
//7SegLED
const int ledArray = 8;
const int EEPROMAddress = 0;