Skip to content

Instantly share code, notes, and snippets.

View mustafakibar's full-sized avatar
:octocat:
kibar

kibar mustafakibar

:octocat:
kibar
View GitHub Profile

The ffast and the Furious

This is a small and admittedly contrived demo showing how some weird but safe code could become vulnerable if run in an environment where some shared library has changed the FPU's FTZ/DAZ bits to force denormals to zero.

To run it:

# Create an empty file
$ touch gofast.c      
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@philipjkim
philipjkim / iter_test.rs
Last active March 15, 2024 00:15
Rust: Difference between iter(), into_iter(), and iter_mut()
#[test]
fn iter_demo() {
let v1 = vec![1, 2, 3];
let mut v1_iter = v1.iter();
// iter() returns an iterator of slices.
assert_eq!(v1_iter.next(), Some(&1));
assert_eq!(v1_iter.next(), Some(&2));
assert_eq!(v1_iter.next(), Some(&3));
assert_eq!(v1_iter.next(), None);
@hjJunior
hjJunior / jwt-payload-parse.dart
Created January 15, 2019 18:00
Get payload of JWT token in Dart language
import 'dart:convert';
Map<String, dynamic> parseJwt(String token) {
final parts = token.split('.');
if (parts.length != 3) {
throw Exception('invalid token');
}
final payload = _decodeBase64(parts[1]);
final payloadMap = json.decode(payload);
@MariaMelnik
MariaMelnik / main.dart
Last active March 3, 2021 23:17
flutter: animated decoration for container (fade in only)
import 'package:flutter/material.dart';
import 'package:transparent_image/transparent_image.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active April 7, 2024 18:33
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@crimsonsuv
crimsonsuv / bottom_sheet_fix.dart
Created November 29, 2018 07:02
Flutter Modal bottom sheet whith input fix and full screen sheet
//Flutter Modal Bottom Sheet
//Modified by Suvadeep Das
//Based on https://gist.github.com/andrelsmoraes/9e4af0133bff8960c1feeb0ead7fd749
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
const Duration _kBottomSheetDuration = const Duration(milliseconds: 200);
@Tea-Ayataka
Tea-Ayataka / Timer.kt
Created September 15, 2018 08:54
Kotlin Coroutine Timer
package net.ayataka.bas.utils
import kotlinx.coroutines.experimental.*
import net.ayataka.bas.LOGGER
import kotlin.system.measureTimeMillis
fun CoroutineScope.timer(interval: Long, fixedRate: Boolean = true, action: suspend TimerScope.() -> Unit): Job {
return launch {
val scope = TimerScope()
@matteocrippa
matteocrippa / flutter.md
Last active October 26, 2023 05:47
Flutter Cheatsheet

Flutter

A quick cheatsheet of useful snippet for Flutter

Widget

A widget is the basic type of controller in Flutter Material. There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.

Stateful

StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like:

@bradtraversy
bradtraversy / ssh.md
Last active April 23, 2024 10:30
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test